/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ucmconfchecker.pExecutionTrace;

import java.util.Date;
import ucmconfchecker.pImplementation.EClass;
import ucmconfchecker.pImplementation.EMethod;
import ucmconfchecker.pImplementation.EObject;
import ucmconfchecker.pImplementation.EThread;

/**
 *
 * @author Administrador
 */
public class ImplEvent {

    private EClass sClass;
    private EMethod sMethod;
    private EObject sObject;
    private EThread sThread;
    private Date timeStamp;
        
    public ImplEvent(EClass sClass,EMethod sMethod,
                     EObject sObject,EThread sThread,Date timeStamp){
       this.sClass = sClass;
       this.sMethod = sMethod;
       this.sObject = sObject;
       this.sThread = sThread;
       this.timeStamp = timeStamp;
    }

    public EClass getEClass() {
        return sClass;
    }

    public EMethod getEMethod() {
        return sMethod;
    }

    public EObject getEObject() {
        return sObject;
    }

    public EThread getEThread() {
        return sThread;
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ImplEvent other = (ImplEvent) obj;
        if ((this.sClass == null) ? (other.sClass != null) : !this.sClass.equals(other.sClass)) {
            return false;
        }
        if ((this.sMethod == null) ? (other.sMethod != null) : !this.sMethod.equals(other.sMethod)) {
            return false;
        }
        if ((this.sObject == null) ? (other.sObject != null) : !this.sObject.equals(other.sObject)) {
            return false;
        }
        if ((this.sThread == null) ? (other.sThread != null) : !this.sThread.equals(other.sThread)) {
            return false;
        }
        if (this.timeStamp != other.timeStamp && (this.timeStamp == null || !this.timeStamp.equals(other.timeStamp))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        return toString().hashCode();
    }

    

    @Override
    public String toString(){
        return "["+timeStamp+":"+sThread+"  "+sClass+"@"+sObject+"."+sMethod+"(..)]";
    }
    
}
